.class public Lcom/netease/newsreader/util/FileUtils$DownloadThread;
.super Ljava/lang/Thread;
.source "FileUtils.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/netease/newsreader/util/FileUtils;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "DownloadThread"
.end annotation


# instance fields
.field private imgList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation
.end field

.field private mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .locals 0
    .parameter "context"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;)V"
        }
    .end annotation

    .prologue
    .line 510
    .local p2, mimgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    .line 511
    iput-object p1, p0, Lcom/netease/newsreader/util/FileUtils$DownloadThread;->mContext:Landroid/content/Context;

    .line 512
    iput-object p2, p0, Lcom/netease/newsreader/util/FileUtils$DownloadThread;->imgList:Ljava/util/List;

    .line 513
    return-void
.end method


# virtual methods
.method public run()V
    .locals 8

    .prologue
    .line 517
    iget-object v5, p0, Lcom/netease/newsreader/util/FileUtils$DownloadThread;->imgList:Ljava/util/List;

    invoke-interface {v5}, Ljava/util/List;->size()I

    move-result v4

    .line 518
    .local v4, length:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v4, :cond_0

    .line 537
    iget-object v5, p0, Lcom/netease/newsreader/util/FileUtils$DownloadThread;->imgList:Ljava/util/List;

    invoke-interface {v5}, Ljava/util/List;->clear()V

    .line 538
    return-void

    .line 519
    :cond_0
    iget-object v5, p0, Lcom/netease/newsreader/util/FileUtils$DownloadThread;->imgList:Ljava/util/List;

    invoke-interface {v5, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    .line 520
    .local v2, imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    new-instance v5, Ljava/lang/StringBuilder;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "src"

    invoke-virtual {v2, v7}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {v5}, Lcom/netease/newsreader/util/FileUtils;->access$0(Ljava/lang/StringBuilder;)V

    .line 521
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->access$1()Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, "http://"

    invoke-virtual {v6}, Ljava/lang/String;->length()I

    move-result v6

    const-string v7, "s.cimg.163.com/i/"

    invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;

    .line 522
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->access$1()Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ".220x220.auto.jpg"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 525
    :try_start_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->access$1()Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->access$1()Ljava/lang/StringBuilder;

    move-result-object v6

    .line 526
    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v6

    add-int/lit8 v6, v6, 0x1

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->access$1()Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->length()I

    move-result v7

    .line 525
    invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_1

    .line 528
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->access$1()Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    .line 529
    .local v3, imgUrl:Ljava/lang/String;
    iget-object v5, p0, Lcom/netease/newsreader/util/FileUtils$DownloadThread;->mContext:Landroid/content/Context;

    invoke-static {v3, v5}, Lcom/netease/newsreader/util/PicUtil;->downloadImgToLocal(Ljava/lang/String;Landroid/content/Context;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 518
    .end local v3           #imgUrl:Ljava/lang/String;
    :cond_1
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 532
    :catch_0
    move-exception v0

    .line 534
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1
.end method
